<%@ page language="java" contentType="text/html; charset=BIG5"
	pageEncoding="BIG5"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=BIG5">
<title>Product List</title>
<script src="http://localhost:8080/project/js/jquery.js"></script>
<script src="http://localhost:8080/project/js/jquery-ui.js"></script>
<script type="text/javascript">
$(document).ready(function() {
	$("input[name='previous']").click(function() {
		$("input[name='action']").val("previous");
		$("form[name='actionForm']").submit();
	});
	$("input[name='next']").click(function() {
		$("input[name='action']").val("next");
		$("form[name='actionForm']").submit();
	});
});
</script>
</head>
<body>
	<table>
		<thead>
			<tr>
				<th colspan="2">action</th>
				<th>productName</th>
				<th>salesPrice</th>
				<th>buyPrice</th>
				<th>description</th>
			</tr>
		</thead>
		<tbody>
			<c:forEach var="p" items="${product}">
				<tr>
					<td><form name="form<c:out value="${p.productCode}" />"
							method="post" action="/project/Product/Delete">
							<input type="hidden" name="code"
								value="<c:out value="${p.productCode}" />"><input
								type="button" value="delete"
								onclick="javascript:form<c:out value="${p.productCode}" />.submit()" />
						</form></td>
					<td></td>
					<td><c:out value="${p.productName}" /></td>
					<td><c:out value="${p.salesPrice}" /></td>
					<td><c:out value="${p.buyPrice}" /></td>
					<td><c:out value="${p.description}" /></td>
				</tr>
			</c:forEach>
		</tbody>
	</table>
	<form action="/project/Product/List" method="post" name="actionForm">
		<input type="hidden" name="action" /> <input type="hidden"
			name="page" value="<c:out value="${page}" />" /> <input
			type="button" name="previous" value="previous" /> <input
			type="button" name="next" value="next" />
	</form>
	<a href="/project/index">index</a>
</body>
</html>